using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using SingleUserWebsite.Business.ControllerSingleton;

namespace SingleUserWebsite.UI
{
    public partial class _Default : System.Web.UI.Page
    {

        AccessControl WebSite = AccessControl.Instance;

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void LogIn(object sender, EventArgs e)
        {
            if (WebSite.IsAnyOneOnline())
            {
                Response.Write("Sod off, someone's on");
            }
            else
            {
                WebSite.AddToCache("me", "me");
                Response.Write("You're online! Go ed!");
            }
        }

        protected void LogOut(object sender, EventArgs e)
        {
            WebSite.RemoveFromCache("me");
            Response.Write("Calm down!");
        }
    }
}
